pub_dir=ssh_pubs
dst=~/.ssh/authorized_keys
touch $dst

for pub in $(ls $pub_dir); do
    pub_key=$(cat $pub_dir/$pub)
    pub_key_str=$(echo $pub_key | awk '{print $2}')
    already_has=$(cat $dst | grep "$pub_key_str" | wc -l)
    if [ $already_has == '1' ]; then
        echo "already has" $pub
        continue
    fi
    echo $pub_key >> $dst
done;
